
$(function () {
    console.log('进来了');

    $.get('http://localhost:3000/student', (data) => {
        // console.log(data);


        data.forEach(item => {
            console.log(item);

            let html = `
                <tr>
                    <td>${item.id}</td>
                    <td>${item.stuName}</td>
                    <td>${item.age}</td>
                    <td>${item.classMates}</td>
                

                    <td>
                        <input type="button" value="编辑" onclick="btn_del(${item.id})">
                        <input type="button" value="删除" onclick="btn_del(${item.id})">
                    </td>
                </tr>
              
            `
            $('#tb').append(html)
        });



    })






})


function btn_del(id) {
    console.log('删除了'+id);


    $.delete(`http://localhost:3000/login/:${id}`),(res)=>{
        console.log('111');
    }
    

}